// Copyright 2007 by Rory Plaire (codekaizen@gmail.com)

using System;
using System.Collections.Generic;
using System.Text;

namespace Novas.Net
{
	public class Body
	{
		private BodyType _type;
		private int _bodyNumber;
		private string _name;

		public Body(BodyType type, int bodyNumber, string name)
		{
			if (String.IsNullOrEmpty(name)) throw new ArgumentNullException("name");

			if (type == BodyType.Major && (bodyNumber <= 0 || bodyNumber > 11))
			{
				throw new ArgumentOutOfRangeException("bodyNumber", bodyNumber, "For a major planet, body number must be between 1 and 11");
			}

			_type = type;
			_bodyNumber = bodyNumber;

			if (_name.Length > 1)
			{
				_name = name.Substring(0, 1).ToUpper() + name.Substring(1).ToLower();
			}
			else
			{
				_name = name;
			}
		}

		public BodyType BodyType
		{
			get { return _type; }
		}

		public int BodyNumber
		{
			get { return _bodyNumber; }
		}

		public string Name
		{
			get { return _name; }
		}
	}
}
